Skip to content

Conversation

@lukeina2z
Copy link
Contributor

Problem:
All Lambda Java users using HandleStreamRequest experience broken application signal traces. This issue affects all Spring Boot 3 users.

Cause:
AWS Lambda for Java provides two handler interfaces: com.amazonaws.services.lambda.runtime.RequestHandler com.amazonaws.services.lambda.runtime.RequestStreamHandler However, instrumentation for RequestStreamHandler is missing in the OpenTelemetry Java agent.

Fix:
Added instrumentation support for RequestStreamHandler.

Test:
Unit tests pass (./gradlew spotlessCheck assemble instrumentation:test). Manual end-to-end tests pass:
Deployed Lambda functions with Spring Boot 3 and Amazon Serverless Java Container. Enabled application signals, observed broken traces. Disabled application signals and added a private build of the Java layer for Lambda with this change. Verified traces and spans are now correct.

Backward Compatibility:
No risk of breaking existing functionality.
The change only adds instrumentation for RequestStreamHandler without modifying existing behavior for RequestHandler. Existing users not using RequestStreamHandler remain unaffected.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Problem:
All Lambda Java users using HandleStreamRequest experience broken application signal traces. This issue affects all Spring Boot 3 users.

Cause:
AWS Lambda for Java provides two handler interfaces:
com.amazonaws.services.lambda.runtime.RequestHandler
com.amazonaws.services.lambda.runtime.RequestStreamHandler
However, instrumentation for RequestStreamHandler is missing in the OpenTelemetry Java agent.

Fix:
Added instrumentation support for RequestStreamHandler.

Test:
Unit tests pass (./gradlew spotlessCheck assemble instrumentation:test).
Manual end-to-end tests pass:
Deployed Lambda functions with Spring Boot 3 and Amazon Serverless Java Container.
Enabled application signals, observed broken traces.
Disabled application signals and added a private build of the Java layer for Lambda with this change.
Verified traces and spans are now correct.

Backward Compatibility:
No risk of breaking existing functionality.
The change only adds instrumentation for RequestStreamHandler without modifying existing behavior for RequestHandler.
Existing users not using RequestStreamHandler remain unaffected.
@lukeina2z lukeina2z requested a review from a team as a code owner March 5, 2025 18:00
@wangzlei wangzlei merged commit 9f7f969 into aws-observability:release/v1.33.x Mar 7, 2025
4 checks passed
@lukeina2z lukeina2z deleted the v1.33.x-lk-handler-pr branch March 23, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants